package com.ambercrm.business.main;

import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;

import com.ambercrm.R;
import com.ambercrm.base.BaseActivity;
import com.ambercrm.business.login.LoginActivity;
import com.ambercrm.constant.Constant;
import com.ambercrm.tools.EmptyUtils;

public class LauncherActivity extends BaseActivity {

    Handler mHandler;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN , WindowManager.LayoutParams. FLAG_FULLSCREEN);
        setContentView(R.layout.activity_launcher);
        mHandler = new Handler();
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (EmptyUtils.notEmpty(sp.getValue(Constant.sp_Token))) {
                    startActivity(MainActivity.class, null, true);
                }
                else {
                    startActivity(LoginActivity.class, null, true);
                }
            }
        }, 2000);

    }
}